import { setStore,getStore} from '@/utils/common'
export default {
	login({ commit },res) {
		let member = '';
        if(res){//会员中心获取个人信息时
            member = res;
		}else{//页面刷新时
            if(getStore('member')){
                member = JSON.parse(getStore('member'));
            }
		}
		setStore('member',member);
		commit('MEMBER',member);
	},
	logout({commit}){
		setStore('member','');
		commit('MEMBER','');
	}
}